#ifndef _COBJMODEL_H_
#define _COBJMODEL_H_

//#include <windows.h>
//#include <fstream>
#include <deque>
//#include <gl/gl.h>
//#include <gl/glu.h>
//#include <dkglObject.h>

//using namespace std;
//using namespace DKGL;

class COBJFace
{
public:
	deque<unsigned int>	m_vID;
	deque<unsigned int>	m_vtID;
	deque<unsigned int>	m_vnID;
	String				mMaterialName;
};

class COBJModel
{
public:

	COBJModel ();

	virtual ~COBJModel ();

	bool LoadModel (const char filepath);

	unsigned int IsError ();

	//virtual void drawEntity ();
	
protected:

	deque<Vector3>	m_v;
	deque<Vector3>	m_vn;
	deque<Vector2>	m_vt;
	deque<COBJFace>	m_f;

	char			m_order[4];

	unsigned int	m_iErrorCode;

	static const int BUF_LEN		= 1024;

	static const int OBJERR_NONE	= 0;	// no error
	static const int OBJERR_OPEN	= 1;	// open file error
	static const int OBJERR_STRUCT	= 2;	// file struct error

private:

	void Init ();

	void ReadFaces (const char* mat, char *);

};

#endif
